package com.blacktech.dbu.core.dict;

import lombok.Getter;

/**
 * 数据权限类型
 *
 * @author Yanyunsong
 */
@Getter
public enum PermissionType {

    /**
     * 产品负责人 - 完全控制权限
     */
    OWNER(Level.OWNER, "负责人", "完全控制权限"),

    /**
     * 产品协作员 - 读写权限
     */
    COLLABORATOR(Level.COLLABORATOR, "协作员", "读写权限"),

    /**
     * 产品报告员 - 只读权限
     */
    REPORTER(Level.REPORTER, "报告员", "只读权限");

    /**
     * 权限级别
     * <p>
     * 数字越低权限越高
     */
    private final int permissionLevel;
    /**
     * 显示名
     */
    private final String displayName;
    /**
     * 说明
     */
    private final String description;

    PermissionType(int permissionLevel, String displayName, String description) {
        this.permissionLevel = permissionLevel;
        this.displayName = displayName;
        this.description = description;
    }

    public interface Level {
        int OWNER = 1;
        int COLLABORATOR = 2;
        int REPORTER = 3;
    }
}